package com.sdms.core.login;

import java.util.Calendar;
import java.util.UUID;

import com.sdms.core.rbac.Role;

public class UserSession
{
	private String userName;
	private long lastAccess;
	private Role role;
	private String sessionId;
	
	public UserSession() {
		this.sessionId = UUID.randomUUID().toString();
		this.lastAccess = Calendar.getInstance().getTimeInMillis();
	}
	
	
	public String getSesionId()
	{
		return this.sessionId;
	}

	public String getUserName()
	{
		return userName;
	}
	
	public void setUserName( String userName )
	{
		this.userName = userName;
	}
	
	public long getLastAccess()
	{
		return lastAccess;
	}
	
	public void setLastAccess( long lastAccess )
	{
		this.lastAccess = lastAccess;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public Role getRole() {
		return role;
	}
}
